<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@page import="org.apache.bsf.engines.javascript.JavaScriptEngine"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>录入人员信息</title>
<link rel="stylesheet" type="text/css" href="jquery/jquery-ui-1.8.19.custom.css" />
<link rel="stylesheet" type="text/css" href="jquery/flexigrid.pack.css"/>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="jquery/jquery.min.js"></script>
<script type="text/javascript" src="jquery/jquery-ui-1.8.19.custom.min.js"></script>
<script type="text/javascript" src="jquery/flexigrid.pack.js"></script>
<script type="text/javascript" src="script/commons.js"></script>
<script type="text/javascript" src="script/calendar.js"></script>
<script type="text/javascript" src="script/objects.js"></script>
<style type="text/css">
.title {
	text-align: right;
	width: 70px;
}
.value {
	text-align: left;
}
.big {
	width: 210px;
}
.small {
	width: 170px;
}
</style>
<script type="text/javascript">
	function check(s) {
		$("#toExcel").val(s);
		$("form").submit();
	}

	$(function() {
		var gridHeight = window.screen.availHeight - 350;
		$("#mainTable").flexigrid({
			height : gridHeight
		});
	});
</script>
</head>
<body>
	<html:form action="balanceexcel.do" method="post">
        <div id="setWidth">
            <div class="button_bar xbutton_bar_img bottomBorder">
                <input type="button" value="新增" onclick="to('forwardbalanceadd.do');" />
                <input type="button" value="删除" onclick="deleteSelected('b', false)" />
                <input type="button" value="记账" onclick="deleteSelected('b', true)" />
                &nbsp;&brvbar;&nbsp;&nbsp;
                <input type="button" value="查询" onclick="check('false')" />
                <input type="button" value="导出" onclick="check('true')" />
                <html:hidden property="toExcel" styleId="toExcel" />
            </div>
            <div class="button_bar">
                <table class="query_form_table">
                    <tr>
                        <th class="title">客户名称：</th>
                        <th class="big value">
                            <html:text property="customer" styleClass="paddingText" styleId="cus"></html:text></th>
                        <th class="title">费用性质：</th>
                        <th class="small value">
                            <label><html:checkbox property="gatherWay" value="我方代付">我方代付</html:checkbox></label>&nbsp;
                            <label><html:checkbox property="gatherWay" value="对方代付">对方代付</html:checkbox></label></th>
                        <th class="title">单据状态：</th>
                        <th class="value">
                            <label><html:checkbox property="isClosed" value="1">已记账</html:checkbox></label>&nbsp;
                            <label><html:checkbox property="isClosed" value="0">未记账</html:checkbox></label></th>
                    </tr>
                    <tr>
                        <th class="title">制单日期：</th>
                        <th class="big value">
                        <html:text property="writeDate_Begin" styleClass="calendar" 
                                onclick="show_cele_date(this,'','',this)"
                                onfocus="show_cele_date(this,'','',this)"></html:text>
                        -
                        <html:text property="writeDate_End" styleClass="calendar" 
                                onclick="show_cele_date(this,'','',this)"
                                onfocus="show_cele_date(this,'','',this)"></html:text></th>
                        <th class="title">日期：</th>
                        <th class="value" colspan="3">
                        <html:text property="fitmentDate_Begin" styleClass="calendar" 
                                onclick="show_cele_date(this,'','',this)"
                                onfocus="show_cele_date(this,'','',this)"></html:text>
                        -
                        <html:text property="fitmentDate_End" styleClass="calendar" 
                                onclick="show_cele_date(this,'','',this)"
                                onfocus="show_cele_date(this,'','',this)"></html:text></th>
                    </tr>
                </table>
            </div>
            <table id="mainTable">
                <thead>
                <tr>
                    <th width="20"><input type="checkbox" onclick="checkAllChecker()" /></th>
                    <th width="80">单据编号</th>
                    <th width="200">渠道名称</th>
                    <th width="200">店铺名称</th>
                    <th width="90">日期</th>
                    <th width="90">装修日期</th>
                    <th width="90">记账日期</th>
                    <th width="80">费用性质</th>
                    <th width="80">店铺面积（m²）</th>
                    <th width="100" class="price">金额(元)</th>
                    <th width="200">备注</th>
                </tr>
                </thead>
                <tbody>
            <c:if test="${listsize!=0}">
                <c:forEach var="list" items="${list}" varStatus="i">
                <tr>
                    <td>
                    <c:if test="${!list.isClosed}">
                    <input type="checkbox" name="checker" value="${list.balanceId}" onpropertychange="changeColor(this)" />
                    </c:if></td>
                    <td>
                        <c:if test="${!list.isClosed}">
                        <a href="forwardbalanceadd.do?modifyId=${list.balanceId}">B${list.balanceId}</a>
                        </c:if>
                        <c:if test="${list.isClosed}">
                        B${list.balanceId}
                        </c:if></td>
                    <td>${list.finCustomer.customer}</td>
                    <td>${list.shop.customer}</td>
                    <td>${list.fitmentDate}</td>
                    <td>${list.decorationDate}</td>
                    <td class="closeDate">
                    <c:choose>
                        <c:when test="${list.closeDate == null}">
                        -
                        </c:when>
                        <c:otherwise>
                        ${list.closeDate}
                        </c:otherwise>
                    </c:choose></td>
                    <td>${list.costProperty}</td>
                    <td>${list.shopArea}</td>
                    <td class="sumPrice separators price">${list.balancePrice2}</td>
                    <td>${list.balanceRemark}</td>
                </tr>
                </c:forEach>
                <tr>               
                    <td class="list_data_number" colspan="9">&nbsp;</td>
                    <td class="footer separators price">Sum：<span id="sumPrice">0</span></td>
                    <td class="list_data_number">&nbsp;</td>
                </tr>
            </c:if>
            </tbody>
            </table>
        </div>
	</html:form>
</body>

</html>